package com.chenx.myapplicationnav.ui.home.db

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.Query


@Dao
interface UserDao {
    @get:Query("SELECT * FROM user")
    val all: List<User?>?

    @Query("SELECT * FROM user WHERE uid IN (:userIds)")
    fun loadAllByIds(userIds: IntArray?): List<User?>?

    @Query(
        "SELECT * FROM user WHERE firstName LIKE :first AND " +
                "lastName LIKE :last LIMIT 1"
    )
    fun findByName(first: String?, last: String?): User?

    @Insert
    fun insertAll(vararg users: User?)

    @Delete
    fun delete(user: User?)
}

